//
//  UIBarItem+AWTheme.m
//  changeShin
//
//  Created by Alan Wang on 2019/3/26.
//  Copyright © 2019 Alan Wang. All rights reserved.
//

#import "UIBarItem+AWTheme.h"
#import "NSObject+AWTheme.h"

@implementation UIBarItem (AWTheme)
-(void)AWTheme_ImageForKey:(NSString*)key{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.image = [[AWThemeManager shareInstance] imageForKey:key];
    } forKey:@"image"];
}

-(void)AWTheme_TitleForKey:(NSString*)key{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.title = [[AWThemeManager shareInstance] stringForKey:key];
    } forKey:@"title"];
}


-(void)AWTheme_ImageForName:(NSString*)key formBuddle:(NSString*)buddleName{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.image = [[AWThemeManager shareInstance] imageForName:key fromBudddle:buddleName];
    } forKey:@"image"];
}
@end
